Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Object Store implementation #150

Merged
merged 11 commits into from
Oct 17, 2023
Merged

Initial Object Store implementation #150

merged 11 commits into from
Oct 17, 2023

Conversation

mtmk
Copy link
Collaborator

@mtmk mtmk commented Oct 12, 2023

Object store initial implementation.

Features:

  • Create/delete stores
  • get/put/delete objects

Missing features:

  • linked objects/buckets

@mtmk mtmk changed the title [WIP] Initial Object Store implementation Initial Object Store implementation Oct 16, 2023
@mtmk mtmk marked this pull request as ready for review October 16, 2023 13:44
@mtmk mtmk requested a review from caleblloyd October 16, 2023 13:44
@@ -18,6 +18,21 @@ public interface ICountableBufferWriter : IBufferWriter<byte>
int WrittenCount { get; }
}

public readonly struct FixedSizeMemoryOwner : IMemoryOwner<byte>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, what is the benefit of using this over MemoryPool<byte>.Shared ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MemoryPool.Shared.Rent returns at least the size asked for, which usually rounds up to some 2^n. This wrapper chops the memory to exact size so when it's passed to stream read/write or down the line to publish or something you won't need to pass the actual size.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, we are still renting it from MemoryPool.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, we are still renting it from MemoryPool.

Ah, I see that now. Clever!

# Conflicts:
#	NATS.Client.sln
Copy link
Collaborator

@caleblloyd caleblloyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mtmk mtmk merged commit 5430c18 into main Oct 17, 2023
9 checks passed
@mtmk mtmk deleted the obj-store-initial-impl branch October 17, 2023 17:24
mtmk added a commit that referenced this pull request Oct 20, 2023
* Initial Object Store implementation (#150)
* TLS first connection (#156)
* Consume clean exit fixes (#161)
* Add NatsMemoryOwner (#162)
@mtmk mtmk mentioned this pull request Oct 20, 2023
mtmk added a commit that referenced this pull request Oct 20, 2023
* Release prep 2.0.0-alpha.5

* Initial Object Store implementation (#150)
* TLS first connection (#156)
* Consume clean exit fixes (#161)
* Add NatsMemoryOwner (#162)

* Pack object store
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants